<?php
class Upassword_ctl extends Ctl{
    function __construct(){
    }
    function main(array $getVars) {
        $this::sessver();
        $type=!empty($_POST['type'])?$_POST['type']:false;
        if(!$type){
			$uid=$_POST['uid'];
			$pass1=$_POST['pass1'];
			$pass2=$_POST['pass2'];
			$flog= xdb::getInstance()->getvar("select count(1) from `user` where id=".$uid." and `password` like '".$pass1."'");
			if($flog){
				$array1=array();
				$array2=array();
				$array1['password']=$pass2;
				$array2['id']=$uid;
				xdb::getInstance()->updb("user",$array1,$array2);
				echo 1;
			}else{
				echo 0;
			}
        }
    }
}